nano: set nano as default EDITOR for nano-plus/full
authorHannu Nyman <[email protected]>
Sun, 9 Nov 2025 10:15:32 +0000 (12:15 +0200)
committerHannu Nyman <[email protected]>
Sun, 9 Nov 2025 10:15:32 +0000 (12:15 +0200)
Set nano as the default EDITOR via /etc/profile.d for those apps
that respect the variable. Only for nano-plus and nano-full variants.

Suggested-by: Anthony Sepa <[email protected]>
Signed-off-by: Hannu Nyman <[email protected]>
(cherry picked from commit d4f6c9c322e491dbf881774ac8e33487872dd00c)

utils/nano/Makefile
utils/nano/files/nano-default-editor.sh [new file with mode: 0644]

index 77f8a2204815e89007a50a80640d1748e57ba6ee..79500e5b15daa74f3dd177c26fd9d40f5cfa5599 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nano
 PKG_VERSION:=8.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/nano
@@ -65,6 +65,7 @@ endef
 define Package/nano-plus/description
   nano-plus - Additional features enabled, larger size than default nano.
   (multibuffer, Unicode/UTF-8, help, justify, nanorc, some key bindings)
+  Nano set as the default EDITOR in the shell profile.
 
   $(call Package/nano/description)
 endef
@@ -73,6 +74,7 @@ define Package/nano-full/description
   nano-full - all features, including syntax highlighting (also uci),
   multibuffer, Unicode/UTF-8, nanorc, some key bindings.
   (libmagic-based file type detection is disabled)
+  Nano set as the default EDITOR in the shell profile.
 
   Example /etc/nanorc is included. nanorc documentation at
   https://www.nano-editor.org/dist/latest/nanorc.5.html
@@ -133,10 +135,12 @@ endef
 
 define Package/nano-plus/install
        $(call Package/nano/install,$1)
+       $(INSTALL_DIR) $(1)/etc/profile.d
+       $(INSTALL_DATA) ./files/nano-default-editor.sh $(1)/etc/profile.d
 endef
 
 define Package/nano-full/install
-       $(call Package/nano/install,$1)
+       $(call Package/nano-plus/install,$1)
        $(INSTALL_DIR) $(1)/etc $(1)/usr/share/nano
        $(INSTALL_DATA) ./files/nanorc $(1)/etc/nanorc
        $(INSTALL_DATA) ./files/uci.nanorc $(1)/usr/share/nano
diff --git a/utils/nano/files/nano-default-editor.sh b/utils/nano/files/nano-default-editor.sh
new file mode 100644 (file)
index 0000000..3a23154
--- /dev/null
@@ -0,0 +1,2 @@
+export EDITOR=/usr/bin/nano
+